package DomainLayer;

public class InvoiceLoan
{
    private String info;
    private double deposit;
    private double pricePerDay;
    private int days;

    /**
     * @param info loan iformation
     * @param deposit an amount of money customer we'll need to leave for renting.
     * @param pricePerDay a price for day renting a tool.
     * @param days a numeber of days customer is renting a tool.
     */
    public InvoiceLoan(String info, double deposit, double pricePerDay, int days)
    {
        this.info=info;
        this.deposit=deposit;
        this.pricePerDay=pricePerDay;
        this.days=days;
    }
    
    public String getInfo()
    {return info;
    }
    
    public double getPricePerDay()
    {
        return pricePerDay;
    }
    
    public double getDeposit()
    {
        return deposit;
    }
    
    
    public double getTotalPrice()
    {
        return getPricePerDay()* (double)days;
    }
    
    //@return String an information about the leasing tool.
    public String printInvoiceLoan()
    {
        String s= getInfo();
        if(getTotalPrice()>=getDeposit())
        {
            s+="Customer has to pay " + (getTotalPrice()-getDeposit()) + " more" + '\n';
        }
        else
        {
            s+="Customer has to get back " + (getDeposit()-getTotalPrice()) + '\n';
        }
        return s;
    }
    
}
